/*
 * @Author       : NaN 353362604@qq.com
 * @Date         : 2023-06-01 09:47:40
 * @LastEditTime : 2023-07-26 17:10:07
 * @LastEditors  : NaN 353362604@qq.com
 * @FilePath     : \AdminStration\src\Common\Router\MenuNav\TwoRouter\FormConsigneeRecord.jsx
 * @Description  :
 */
import { API_LIST } from '../../../Api/Api'
import { commonTableList } from '../Common/common'
import { DelDataButton, OpenThrTouter } from '../Common/options'

export const FormConsigneeRecord = async ({ OptionsEvent, oneData, Permission, actionRef, ClientData }) => {
    let dataList = {
        hideInSearch: true,
        pageSize: 10,
        params: { formUuid: oneData.uuid },
        get: API_LIST()['getFormConsigneeRecord'],
        options: [
            oneData.approvalStatus === 0 && (
                <OpenThrTouter
                    title="新增人员"
                    type="primary"
                    icon="add"
                    twoTitle="新增接收人员"
                    modal="SelectModal"
                    OptionsEvent={OptionsEvent}
                    other={{
                        page: 'FormConsigneeRecord',
                        actionRef,
                        Permission,
                        twoData: oneData,
                    }}
                />
            ),
        ],
        columns: [
            commonTableList.uuid,
            {
                title: '人员id',
                dataIndex: 'userUuid',
                search: false,
                type: 'hidden',
                hideInTable: true,
            },
            {
                dataIndex: 'organizationName',
                title: '组织机构',
            },
            {
                dataIndex: 'tableName',
                title: '账户',
            },
            {
                dataIndex: 'fullName',
                title: '姓名',
            },
            {
                title: '身份证',
                dataIndex: 'idCard',
            },
            {
                title: '操作',
                valueType: 'systemOperation',
                fixed: 'right',
                width: 100,
                hideInSearch: true,
                hideInAdded: true,
                hideInModify: true,
                render: (_, record) => {
                    const { uuid } = record
                    return [
                        oneData.approvalStatus === 0 && (
                            <DelDataButton
                                OptionsEvent={OptionsEvent}
                                key="del"
                                title="删除"
                                url="FormConsigneeRecord"
                                uuid={uuid}
                            />
                        ),
                    ]
                },
            },
        ],
    }
    return dataList
}
